package com.example.project.projectspringcloud.service.impl.order;

import com.example.project.projectspringcloud.common.Constants;
import com.example.project.projectspringcloud.dao.order.OrderComboMapper;
import com.example.project.projectspringcloud.entity.order.OrderCombo;
import com.example.project.projectspringcloud.service.BaseService;
import com.example.project.projectspringcloud.service.order.OrderComboService;
import com.example.project.projectspringcloud.utils.RedisUtil;
import com.google.common.collect.Lists;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 套餐Service
 */
@Service
@Transactional
public class OrderComboServiceImpl extends BaseService<OrderCombo, OrderComboMapper> implements OrderComboService {

    @Override
    public OrderCombo get(OrderCombo entity) {
        return super.mapper.selectOne(entity);
    }

    @Override
    public List<OrderCombo> list(OrderCombo entity) {
        return super.list(null, entity);
    }

    @Override
    public boolean save(OrderCombo entity) {
        return super.save(entity);
    }

    @Override
    public List<OrderCombo> columnList(OrderCombo entity, Integer type) {
        switch (type) {
            case 1:
                return super.mapper.columnList(entity);
            case 2:
                return super.mapper.columnGroup(entity);
            case 3:
                return super.mapper.columnTag(entity);
            default:
                return null;
        }
    }

}
